<?php

namespace App\Admin\Renderables;

use App\Models\ChatContentModel;
use Illuminate\Contracts\Support\Renderable;

class ChatContent implements Renderable
{
    private $comments;

    public function __construct($myId, $userId)
    {
        $aa = new ChatContentModel();
        $this->comments = $aa->where('sender', $myId)->where('receiver', $userId)->orWhere('sender', $userId)->Where('receiver', $myId)->get();
    }
    public function render()
    {
        return view('admin.pages.components.chat-content', [
            'array' => $this->comments
        ]);
    }
}
